<!--
  To change this template, choose Tools | Templates
  and open the template in the editor.
-->

<%@ page contentType="text/html;charset=UTF-8" %>

<html>
  <head>
    <meta name="layout" content="main"/>
    <title>Account - Profile and Edit</title>
    <link rel="stylesheet" media="screen" href="${resource(dir:'css',file:'reset.css')}"/>
  <g:javascript library='jquery' plugin='jquery' />
  <jqui:resources />
  <link rel="stylesheet" media="screen" href="${resource(dir:'css/smoothness',file:'jquery-ui-1.8.2.custom.css',plugin:'spring-security-ui')}"/>
  <link rel="stylesheet" media="screen" href="${resource(dir:'css',file:'jquery.jgrowl.css')}"/>
  <link rel="stylesheet" media="screen" href="${resource(dir:'css',file:'jquery.safari-checkbox.css')}"/>
  <link rel="stylesheet" media="screen" href="${resource(dir:'css',file:'date_input.css')}"/>
  <link rel="stylesheet" media="screen" href="${resource(dir:'css',file:'jquery.jdMenu.css')}"/>
  <link rel="stylesheet" media="screen" href="${resource(dir:'css',file:'jquery.jdMenu.slate.css')}"/>
  <link rel="stylesheet" media="screen" href="${resource(dir:'css',file:'table.css')}"/>
  <link rel="stylesheet" media="screen" href="${resource(dir:'css',file:'spring-security-ui.css')}"/>
</head>
<body>
  <div id="contentText">
    <h2><span>Account</span>Profile and Edit</h2>
  </div>
  <div id="wrap90">

    Username: <b> ${user?.username} </b>
    <br>
    <br>
    <g:form action="update2" name='userEditForm'>
      <g:hiddenField name="id" value="${user?.id}"/>
      <g:hiddenField name="version" value="${user?.version}"/> 
      <g:hiddenField name="username" value="${user?.username}"/>
      <s2ui:tab name='userinfo' height='300'>
        <table>
          <tbody>
          <s2ui:textFieldRow name='name' labelCode='Name' bean="${user}"
                             labelCodeDefault='Name' value="${user?.name}"/>
          <s2ui:textFieldRow name='lastname' labelCode='LastName' bean="${user}"
                             labelCodeDefault='Lastname' value="${user?.lastname}"/>
          <s2ui:textFieldRow name='address1' labelCode='Address1' bean="${user}"
                             labelCodeDefault='Address1' value="${user?.address1}"/>
          <s2ui:textFieldRow name='address2' labelCode='Address2' bean="${user}"
                             labelCodeDefault='Address2' value="${user?.address2}"/>
          <s2ui:textFieldRow name='postal' labelCode='Postal' bean="${user}"
                             labelCodeDefault='Postal' value="${user?.postal}"/>
          <s2ui:textFieldRow name='phonenumber' labelCode='Postal' bean="${user}"
                             labelCodeDefault='Phonenumber' value="${user?.phonenumber}"/>

          </tbody>
        </table>
      </s2ui:tab>
      <div>
        <s2ui:submitButton elementId='update2' form='userEditForm' messageCode='default.button.update.label'/>

        <g:if test='${user}'>
          <s2ui:deleteButton />
        </g:if>

    </g:form>

    <g:if test='${user}'>
      <s2ui:deleteButtonForm instanceId='${user.id}'/>
    </g:if>
  </div>
</div>

</body>
</html>
